<?php

declare(strict_types=1);

namespace App\Request\Client\User;

use App\Constants\Model\UserWithdraw;
use Hyperf\Validation\Request\FormRequest;
use Hyperf\Validation\Rule;

class WithdrawRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'type' => [
                'required',
                Rule::in(
                    [
                        UserWithdraw::GOLD_TYPE_COMMISSION,
                        UserWithdraw::GOLD_TYPE_AWARD
                    ]
                )
            ],
            'gold' => 'required|integer|min:0|not_in:0'
        ];
    }

}